/*
 * TockenBucketProfiler.h
 *
 *  Created on: 12-12-2013
 *      Author: Tomasz Lis
 */

#ifndef TOCKENBUCKETPROFILER_H_
#define TOCKENBUCKETPROFILER_H_

#include <omnetpp.h>
#include <csimplemodule.h>
#include <vector>
#include <packet_m.h>
#include <math.h>
#include <fstream>

using namespace std;

class TokenBucketProfiler: public cSimpleModule {
public:
    simtime_t lastPacketTime;
    cLongHistogram histogram;
    cOutVector vectorA;

    int numberOfDeletedMinPrior;
    int numberOfDeletedMaxPrior;
    int numberOfDeleted;
    int numberOfForward;
    int currentTokens;

    unsigned int maxTokens;
    unsigned int tokens;
    int bytePerToken;
    double timePeriod;
    unsigned int maxSize;
    simtime_t lastForward;
    vector<Packet*> queue;
    cMessage* event;
    TokenBucketProfiler();
    virtual ~TokenBucketProfiler();
    virtual void initialize();
    void sendPacket();
    virtual void handleMessage(cMessage* msg);
    virtual void finish();
};
Define_Module(TokenBucketProfiler);
#endif /* TOCKENBUCKETPROFILER_H_ */
